package com.dlc.yunguang.net.bean;

import android.os.Parcel;
import android.os.Parcelable;
import com.dlc.yunguang.model.intfc.ProductList;
import java.util.List;

/**
 * Created by John on 2017/7/24.
 */

public class ProducerBean {
    /**
     * code : 1
     * msg : 查询成功
     * data : [{"id":"1","company_id":"0","category_id":"1","spec_id":"1","title":"纯棉毛巾12*12","content":"","producer_id":"","cost":"1.00","nums":"0","remark":"","producer":null},{"id":"2","company_id":"0","category_id":"1","spec_id":"2","title":"纯棉毛巾16*16","content":"","producer_id":"","cost":"2.00","nums":"0","remark":"","producer":null}]
     */

    public int code;
    public String msg;
    public List<DataBean> data;

    public static class DataBean implements ProductList,Parcelable {
        /**
         * "id": "1",//产品ID
         * "company_id": "0",//工厂ID
         * "category_id": "1",//分类ID
         * "spec_id": "1",//规格ID
         * "title": "纯棉毛巾12*12",//产品名称
         * "content": "",//产品说明
         * "producer_id": "",//生产商ID
         * "producer": "",//生产商名称
         * "cost": "0.00",//洗涤成本
         * "nums": "0",//库存数量
         * "remark": ""//备注
         */

        public int id;
        public String company_id;
        public int category_id;
        public int spec_id;
        public String title;
        public String content;
        public String producer_id;
        public String cost;
        public int nums;
        public String remark;
        public String producer;
        public String spec_name;

        public int getId() {
            return id;
        }

        public void setId(int id) {
            this.id = id;
        }

        @Override
        public String getName() {
            return title;
        }

        @Override
        public String getSpec() {
            return spec_name;
        }

        @Override
        public String getManufacturer() {
            return producer;
        }

        @Override
        public int getAmount() {
            return nums;
        }

        @Override
        public String getWhere() {
            return null;
        }

        @Override
        public int describeContents() {
            return 0;
        }

        @Override
        public void writeToParcel(Parcel dest, int flags) {
            dest.writeInt(this.id);
            dest.writeString(this.company_id);
            dest.writeInt(this.category_id);
            dest.writeInt(this.spec_id);
            dest.writeString(this.title);
            dest.writeString(this.content);
            dest.writeString(this.producer_id);
            dest.writeString(this.cost);
            dest.writeInt(this.nums);
            dest.writeString(this.remark);
            dest.writeString(this.producer);
        }

        public DataBean() {
        }

        protected DataBean(Parcel in) {
            this.id = in.readInt();
            this.company_id = in.readString();
            this.category_id = in.readInt();
            this.spec_id = in.readInt();
            this.title = in.readString();
            this.content = in.readString();
            this.producer_id = in.readString();
            this.cost = in.readString();
            this.nums = in.readInt();
            this.remark = in.readString();
            this.producer = in.readString();
        }

        public static final Creator<DataBean> CREATOR = new Creator<DataBean>() {
            @Override
            public DataBean createFromParcel(Parcel source) {
                return new DataBean(source);
            }

            @Override
            public DataBean[] newArray(int size) {
                return new DataBean[size];
            }
        };
    }
}
